<?php

use common\components\helpers\Fun;
use yii\helpers\Html;
use yii\helpers\HtmlPurifier;
use common\components\extenders\MenuManage;

?>
<div class="yx-cnt-box">
    <div class="yx-praise-list-box yx-praise-box yx-radius2 zx-min-height">
        <div class="docs-main zx-mg">
            <table id="tablesaw" class="tablesaw table yx-table1 yx-table3 table-striped with-check">
                <thead>
                <tr class="yx-bgd2f6ec">
                    <td>上课时间</td>
                    <td>课次</td>
                    <td>本课内容</td>
                    <td>练习重点</td>
                    <td>练习提问</td>
                    <td>提问回复</td>
                    <td>课程评分</td>
                    <td>老师评分</td>
                    <td>练习评分</td>
                    <td>评分留言</td>
                    <td>操作</td>
                </tr>
                </thead>
                <?php if ($lesson_student != null) {
                    foreach ($lesson_student as $i => $v) { ?>
                        <tr>
                            <td><?= isset($v->classLesson) ? Html::encode(\Yii::$app->formatter->asDatetime($v->classLesson->class_date)) : ''; ?></td>
                            <td><?= isset($v->classLesson) ? Html::encode($v->classLesson->lesson) : ''; ?></td>
                            <td><?= HtmlPurifier::process($v->lesson_content) ?></td>
                            <td><?= HtmlPurifier::process($v->lesson_fouce); ?></td>
                            <td><?= HtmlPurifier::process($v->refouce_notice); ?></td>
                            <td><?= HtmlPurifier::process($v->refouce_answer); ?></td>
                            <td><?= Html::encode($v->lesson_score); ?></td>
                            <td><?= Html::encode($v->teacher_score); ?></td>
                            <td><?= Html::encode($v->refouce_score); ?></td>
                            <td><?= HtmlPurifier::process($v->for_teacher); ?></td>


                            <td>
                                <?php if (isset($v->classLesson) && $v->classLesson->class_date < time()) { ?>
                                    <?= (new MenuManage(MenuManage::TOP_MENU))->detailsMenu('growthlog', 'add', true, ['class' => 'btn yx-radius2 yx-d-card yx-bg94d5a2', 'data' => ['lesson_id' => $v->lesson_id, 'student_id' => $student_id]]); ?>
                                <?php } else { ?>
                                    <span class="button" style="color:#ccc">修改</span>
                                <?php } ?>
                            </td>


                        </tr>
                    <?php }
                } ?>
            </table>
        </div>
    </div>
</div>
